package com.kkb.pay.controller;

import entity.Payment;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PayController {

    @Value("${server.port}")
    private String serverPort;

    @RequestMapping("/pay/{id}")
    public ResponseEntity<Payment> doPay(@PathVariable("id") Integer id){
        Payment payed = new Payment(id, "payed by" + serverPort);
        return ResponseEntity.ok(payed);
    }
}
